#ifdef _SINGLETON_H_

using namespace std;

template<class T> T* Singleton<T>::m_instance = NULL;

template<class T> Singleton<T>::Singleton( void ){}


template<class T> Singleton<T>::~Singleton( void )
{
	destroy();
}

template<class T> T* Singleton<T>::getInstance( void )
{
	if (m_instance == NULL)
	{
		m_instance = new T;
	}
	return m_instance;
}



template<class T>  void Singleton<T>::destroy( void )
{
	delete m_instance;
	m_instance = NULL;
}

#endif
